<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="bean.User"%>
<%@page import="dao.DaoFactory"%>
<%@page import="service.IUserDao"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">    
    <title>更新产品</title>
    <style>
    	
    	input{
    		border:1px solid RGB(99,175,233);
    	}
    </style>
  </head> 
  <%
  request.setCharacterEncoding("utf-8");
  response.setContentType("text/html;charset=utf-8");
  
  int id =Integer.parseInt(request.getParameter("id"));
 
  User u = new User();
  u.setId(id);
  
  IUserDao dao = DaoFactory.getUserDao();
  u=dao.queryByUserId(u);
  
  %>
  <body>
   	<center>
   	<h2>更新用户信息</h2>
   	 <form action="UserServlet?op=update" method="post">
   	 	<table border="0" >
   	 		<tr>
   	 			<td>编号</td>
   	 			<td>
   	 			<input type="text" name="id" readonly="readonly" value="<%=u.getId() %>"/>
   	 			</td>
   	 		</tr>
   	 		<tr>
   	 			<td>姓名</td>
   	 			<td>
   	 			<input style="color:#7a7a7a" type="text" name="name" value="<%=u.getName()%>"/>
   	 			</td>
   	 		</tr>
   	 		<tr>
   	 			<td>密码</td>
   	 			<td>
   	 			<input style="color:#7a7a7a" type="text" name="addr" value="<%=u.getPassword()%>"/>
   	 			</td>
   	 		</tr>
			<tr>
				<td>性别</td>
				<td>
					<input style="color:#7a7a7a" type="text" name="sex" value="<%=u.getSex()%>"/>
				</td>
			</tr>
			<tr>
				<td>年龄</td>
				<td>
					<input style="color:#7a7a7a" type="text" name="age" value="<%=u.getAge()%>"/>
				</td>
			</tr>
			<tr>
				<td>爱好</td>
				<td>
					<input style="color:#7a7a7a" type="text" name="hobby" value="<%=u.getHobby()%>"/>
				</td>
			</tr>
			<tr>
				<td>签名</td>
				<td>
					<input style="color:#7a7a7a" type="text" name="sign" value="<%=u.getSign()%>"/>
				</td>
			</tr>
   	 			
   	 		
   	 	</table>
   	 	<input type="submit" value="提交"/>&nbsp;&nbsp;
   	 	<input type="reset" value="重置"/>
   	 </form>
   	</center>
  </body>
</html>
